<div id="ContentMessage">
	<div id="NoteContentMessage">
		<?php echo $get_message_notnull ?>
	</div>
	
	<div id="ErrorContentMessage">
		<?php echo $lbl_error_msg; ?>
	</div>
</div>		
<form  name='form_main' id="form_main" method="post" action="<?php echo $link_page; ?>" enctype="multipart/form-data">	
<div id="SiteContent_main">			
	
	
	<div id="EditContent">
		<table class="EditStyle01" >
			<tbody>		
			
				<tr>
						<td class="key" width="150" align="right">
						<?php echo $lbl_name; ?><?php echo $get_icon_notnull; ?>					</td>
						<td width="400">
							<input style="width:250px;" type="text" width="" name="txt_cmaterial_products" value="<?php echo $txt_cmaterial_products; ?>">					</td>
				</tr>							
				<tr>
						<td class="key" width="150" align="right">
						<?php echo $lbl_index; ?>					</td>
						<td width="400">
							<input style="width:250px;" type="text" width="" name="txt_cindex" value="<?php echo $txt_cindex; ?>" maxlength="4"/>					</td>
				</tr>
				<tr style="display:none">
					<td align="right" class="key">
						<?php echo 'Thumb left'; ?>						</td>
					<td>
						<input name="txt_cthumb_img" type="file" id="txt_cthumb_img" value ="" size="25" /> 
						<br/>Width:227px; height:385px;
						<div style="position:absolute; top:108px; left:650px;">
							<div style="border:1px #CCC solid;width:190px;height:235px; text-align:center;">
							<?php 
								$url_banner = base_url().'index.php/do_material_product/delete_image/'.$nid; 
							?>
								<div id="images_div">
									<?php 
										if($txt_cthumb_img !='') echo '<img width="150" style=" border:solid 2px #999999;"  height="205" src="'.$fr_img.'upload/banner/'.$txt_cthumb_img.'  "/>';
										else echo 'No image ';
									?>
								</div>
								<?php if($txt_cthumb_img !=''): ?>
									<p style="text-align:center"><a href="#" onclick="javascript:ajax_delete_image();">Delete (Thumb)</a></p>
								<?php else: ?>
									<p style="text-align:center">Thumb</p>
								<?php endif; ?>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td align="right" class="key">
						<?php echo 'Background menu'; ?>						</td>
					<td>
						<input name="txt_cthumb_img_icon" type="file" id="txt_cthumb_img_icon" value ="" size="25" /> 
						<br/>Width:400px; height:400px
						<div style="position:absolute; top:388px; left:650px;">
							<div style="border:1px #CCC solid;width:170px;height:200px; text-align:center;">
							<?php 
								$url_icon = base_url().'index.php/do_material_product/delete_image_icon/'.$nid; 
							?>
								<div id="images_div_icon">
							<?php 
								if($txt_cthumb_img_icon !='') echo '<img width="150" style=" border:none;"  height="150" src="'.$fr_img.'upload/thumb/'.$txt_cthumb_img_icon.'  "/>';
								else echo 'No image ';
							?>
								<?php if($txt_cthumb_img_icon !=''): ?>
								<p style="text-align:center"><a href="#" onclick="javascript:ajax_delete_image_icon();">Delete (Background)</a></p>
								<?php else: ?>
									<p style="text-align:center">Background</p>
								<?php endif; ?>
								</div>
								
							</div>
							
						</div>
					</td>
				</tr>
                <tr>
						<td class="key" width="150" align="right">
						<?php echo $lbl_nstatus; ?>					</td>
						<td width="400"><?php echo $gen_cbo_status ?></td>
				</tr>
				<tr style="display:none">
					<td class="key" width="150" align="right">
						<?php echo $lbl_tag; ?>					</td>
					<td width="400">
						<textarea style="width:300px; height:100px" name="txt_ctag"><?php echo $txt_ctag; ?></textarea></td>
				</tr>
				<tr>
						<td class="key" width="150" align="right">
						<?php echo $lbl_cnote; ?></td>
						<td width="400" height="300">				
						<?php echo $this->fckeditor->Create('txt_cnote',$txt_cnote,'Basic');?>
						</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td>
						<input type="button" name="btn_submit" style="width:80px;" value ="<?php echo $btn_update; ?>" 
							onclick ="js_SetSubmitButtonClick(this.form, this.name);" class="button"/>
													   
						<input name="btn_cancel" style="width:80px;" type="button" 
							   value = "<?php echo $btn_cancel; ?>"
							   onclick="location.href='<?php echo $link_cancel; ?> '" class="button"/>
					</td>
				</tr>		
			
			<tbody>				
		</table>
	</div>
	<input name="hidden_nid" type="hidden" value = "<?php echo $nid; ?>"  />
	<input name="hidden_event" type="hidden" value = "<?php echo $event; ?>"  />
	<input type="hidden" name="hidden_button_click"  value = "" />	
	<input type="hidden" name="hidden_image_old"  value = "<?php echo $txt_cthumb_img; ?>" />
	<input type="hidden" name="hidden_image_old_icon"  value = "<?php echo $txt_cthumb_img_icon; ?>" />
</div>
</form>

<!-- BAT BUOC CAC FORM NHAP LIEU DEU PHAI DUNG SCRIPT NAY. -->

<script type="text/javascript" >

function ajax_delete_image()
	{
		document.form_main.hidden_image_old.value = '';
		pb_display('<?php echo $url_banner ?>','images_div');
	}

function ajax_delete_image_icon()
	{
		document.form_main.hidden_image_old_icon.value = '';
		pb_display('<?php echo $url_icon ?>','images_div_icon');
	}


function js_SetSubmitButtonClick(obj_form, btn_name) 
	{
		obj_form.hidden_button_click.value = btn_name;
		obj_form.submit();		
	}	

</script>